Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>The first p element in the document.</p> <p>Another p element.</p> <p>Click the button to get the HTML content of the first p element (index 0) in this document.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var nodelist = document.getElementsByTagName("P").item(0).innerHTML; document.getElementById("demo").innerHTML = nodelist; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_nodelist_item_doc by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:29:06 GMT --> </html>
Result:
Try it Yourself - © w3schools.com